package com.lingyun.mqttserver.dao.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lingyun.mqttserver.dao.pojo.MqttScreenVariableMappingVariable;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.lang.constant.ConstantDesc;
import java.util.List;
import java.util.Map;

@Mapper
public interface MqttScreenVariableMappingVariableMapper extends BaseMapper<MqttScreenVariableMappingVariable> {

//    // 使用 mqtt_variable_name 作为 Map 的 key
//    @Select("""
//        SELECT
//            m.mqtt_variable_name,
//            v.current_value
//        FROM mqtt_screen_variable_mapping_variable m
//        INNER JOIN lower_computer_variable v ON m.lower_variable_id = v.id
//        WHERE m.screen_id = #{screenId}
//          AND m.mapping_id = #{mappingId}
//          AND m.lower_computer_id = #{lowerComputerId}
//        """)
////    @MapKey("mqtt_variable_name")
//    List<Map<String, Object>> selectVariablesWithValues(
//            @Param("screenId") Integer screenId,
//            @Param("mappingId") Integer mappingId,
//            @Param("lowerComputerId") Integer lowerComputerId
//    );

}
